<?xml version="1.0" encoding="UTF-8"?>
<ui:component xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

	<ui:composition template="/pages/templates/layout_principal.xhtml">
		<ui:define name="message">
			<rich:messages globalOnly="true" showSummary="true" showDetail="true">
			</rich:messages>
		</ui:define>

		<ui:define name="body">
			<h:form>
				<h:panelGrid styleClass="titulo">
					<h:outputText styleClass="titulo" value="#{menuControl.nomeProjetoSelecionado} - Novo Risco"  />
				</h:panelGrid>
				
				<br />
				
				<h:panelGrid columns="2">
					<h:outputText value="*Risco:" styleClass="form_label" />
					<h:panelGroup>
						<h:inputText value="#{manterRiscoControl.risco.nomeRisco}" id="nome" required="true" maxlength="40" size="44" />
						<rich:message for="nome" />
					</h:panelGroup>
					
						
					<h:outputText value="Descrição:" styleClass="form_label" />
					<h:panelGroup>
					
						<h:inputTextarea value="#{manterRiscoControl.risco.descricao}" id="descricao" cols="50" rows="4">
							<f:validateLength maximum="200" />
						</h:inputTextarea>
						<rich:message for="descricao" />
					</h:panelGroup>
					
						<h:outputText value="Gravidade:" styleClass="form_label" />
					<h:panelGroup>
						
							<h:selectOneMenu id="gravidade" value="#{manterRiscoControl.risco.gravidade}">
								<f:selectItems value="#{manterRiscoControl.listaGravidade}" var="gravidade" 
									itemValue="#{gravidade}" itemLabel="#{gravidade.descricao}" />
							</h:selectOneMenu>
						<rich:message for="gravidade" />
					</h:panelGroup>
					
						<h:outputText value="Plano de contingência:" styleClass="form_label" />
						<h:panelGroup>
							<h:inputTextarea value="#{manterRiscoControl.risco.planoContingencia}" id="contingencia" cols="50" rows="4">
								<f:validateLength maximum="200" />
							</h:inputTextarea>
													
						<rich:message for="contingencia" />
					</h:panelGroup>
					
					<h:outputText value="Plano de prevenção:" styleClass="form_label" />
					<h:panelGroup>
						
							<h:inputTextarea value="#{manterRiscoControl.risco.planoPrevencao}" id="prevencao" cols="50" rows="4">
								<f:validateLength maximum="200" />
							</h:inputTextarea>
						<rich:message for="prevencao" />
					</h:panelGroup>
					
					<h:outputText value="Manifestado:" styleClass="form_label" />
					<h:panelGroup>
						<h:selectBooleanCheckbox value="#{manterRiscoControl.risco.manifestado}" />
						<rich:message for="manifestado" />
					</h:panelGroup>    

       					 <br />
					
									
				</h:panelGrid>
			
								
				<br />
				
				<h:panelGrid columns="3" cellpadding="3" styleClass="botoes">
					<h:commandButton action="#{manterRiscoControl.incluirRisco()}" value="Incluir" rendered="#{manterRiscoControl.exibirIncluir}" />
					<h:commandButton action="#{manterRiscoControl.alterarRisco()}" value="Alterar" rendered="#{manterRiscoControl.exibirAlterar}" />
					<h:commandButton action="#{manterRequisitosControl.iniciar}" value="Voltar" immediate="true" />
				</h:panelGrid>
			</h:form>
		</ui:define>
	</ui:composition>

</ui:component>